package com.moly.websocketone.controller;

import com.moly.websocketone.annotation.ArgumentAnno;
import com.moly.websocketone.bean.Pet;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:  测试 对 请求参数机解密 对返回结果加密
 * @Author: m01
 * @Date: created at  2018/11/15  16:50
 * @Modified By:
 */

@Controller
@RequestMapping(value = {"/aes"})
public class AESController {


    /**
     * 对返回结果 加密
     * @return
     */
    @RequestMapping(value = {"/testget"})
    public Pet testget(String col){
        Pet p=new Pet();
        p.setName("moly");
        return p;
    }


    /**
     * 对请求参数 解密
     * @param argument
     * @param argument2
     * @return
     */
    @RequestMapping(value = {"/testArgumentAnno"})
    public Pet testArgumentAnno(
            @ArgumentAnno(value = "aes") String argument,
            @ArgumentAnno(value = "aes2",defaultValue = "aes2") String argument2){
        System.out.println(argument);
        System.out.println(argument2);

        Pet p=new Pet();
        p.setName("moly");
        return p;
    }

}

